﻿#region itdc

/************************************************************************
*Copyright(C) 2015 by qsgy
 *All rights reserved. 
 *FileName:     $safeitemname$
 *Author:       oyh
 *Version:      
 *UnityVersion：
 *Date:   $time$      
 *Description:    
 *History: 
************************************************************************/
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// TM信号触发器的基类
/// </summary>
/// <typeparam name="T"></typeparam>
public class MessageTrigger<T> : MonoBehaviour, Sender<T>
{
    //发送的信息
 
    public T sendM;
    public GameObject tagert;
    
    public TMessage<T> Send()
    {
        return new TMessage<T>(sendM);
    }

    /// <summary>
    /// 建立通信
    /// </summary>
    protected void TriggerSend()
    {
        tagert.GetComponent<Receiver<T>>().Reveive(Send());
    }

}
